import { error } from "@tauri-apps/plugin-log";
import { _Flex } from "./Flex";

class _Stack extends _Flex {
    public static id: number = 0;
    constructor() {
        super();
        this._element = document.createElement('div');
        this._element.id = this._id;
    }
    build(parentId?: string): void {
        try {
            super.build(parentId);
            this._children.forEach(v => v.position = 'absolute');
        } catch (e) {
            error(`error building Stack ${e}`);
        }
    }
}

export function Stack() {
    return new _Stack();
}